package wxdb.ui;

import java.util.Arrays;
import java.util.HashMap;

import wxdb.parse.sym;
import wxdb.storage.*;

public class Main {

  public static void main(String argv[]) throws java.io.IOException {
	  Global gb = new Global();
//	  UserIn cp = new UserIn();
//	  System.out.println("OK");
//	  Register rg = new Register();
	  Login lg = new Login();
//	  Management mg = new Management();
//	  ModifyRecord mr = new ModifyRecord();
//	  Setting st = new Setting();
	  
//	  Buffer bf = new Buffer();

//	  StorageMgr smgr = new StorageMgr();
//	  smgr.createDB("t1");
//	  smgr.createDB("t2");
	  
//	  smgr.initNewDB(0);
//	  int a = smgr.allocPage(0);
//	  Page pg = smgr.readBufPage("0;"+a);
	  
/*	  smgr.initNewDB(2);
	  smgr.initNewDB(1);
	  
	  byte con[] = {'x','c','x'};
	  byte con2[] = {'x','c','x','j','a','c','k'};
	  
	  System.out.println(smgr.allocPage(0));
	  System.out.println(smgr.allocPage(0));
	  System.out.println(smgr.allocPage(0));
	  System.out.println(smgr.allocPage(0));
	  System.out.println(smgr.allocPage(0));
	  System.out.println(smgr.allocPage(0));
	  for(int i=0;i<10;i++)
		  smgr.allocPage(0);

	  System.out.println(smgr.getPageCount(0));*/
//	  for(int i=0;i<10*8;i++)
//		  smgr.allocPage(0);

//	  pg = smgr.readBufPage("0;12");
//	  pg.print();

//	  smgr.freeandexit();
//	  Login lg = new Login();
//	  Admin ad = new Admin();
//	  Management mg = new Management("xcxjack");
/*	  HashMap<String,String> hm = new  HashMap<String,String>();
	  hm.put("a", "aaa");
	  hm.put("abc", "abaa");
	  hm.put("b", "bbb");
	  hm.put("c", "ccc");
	  hm.put("d", "ddd");
	  hm.put("e", "eee");
	  hm.put("f", "fff");
	  hm.put("g", "ggg");
	  hm.put("h", "hhh");
	  hm.put("i", "iii");*/
//	  UserIn ui = new UserIn();
//	  System.exit(0);
  }

  static String symnames[] = new String[100];
  static {
     
     symnames[sym.SELECT] = "SELECT";
     symnames[sym.FROM] = "FROM";
     symnames[sym.DELETE] = "DELETE";
     symnames[sym.VALUES] = "VALUES";
     symnames[sym.INTO] = "INTO";
     symnames[sym.LONG] = "LONG";
     symnames[sym.INTEGER] = "INTEGER";
     symnames[sym.FLOAT] = "FLOAT";
     symnames[sym.DOUBLE] = "DOUBLE";
     symnames[sym.REAL] = "REAL";
     symnames[sym.TIME] = "TIME";
     symnames[sym.DATE] = "DATE";
     symnames[sym.VARCHAR] = "VARCHAR"; 
     symnames[sym.CHAR] = "CHAR";
     symnames[sym.INSERT] = "INSERT";
     symnames[sym.DEFAULT] = "DEFAULT";
     symnames[sym.NULL] = "NULL";
     symnames[sym.PLUS] = "PLUS";
     symnames[sym.NOT] = "NOT";
     symnames[sym.TABLE] = "TABLE";
     symnames[sym.CREATE] = "CREATE";
     symnames[sym.IN] = "IN";
     symnames[sym.NEQ] = "NEQ";
     symnames[sym.EQ] = "EQ";
     symnames[sym.GT] = "GT";
     symnames[sym.GE] = "GE";
     symnames[sym.LE] = "LE";
     symnames[sym.LT] = "LT";
     symnames[sym.OR] = "OR";
     symnames[sym.AND] = "AND";
     symnames[sym.DIVIDE] = "DIVIDE";
     symnames[sym.TIMES] = "TIMES";
     symnames[sym.MINUS] = "MINUS";
     symnames[sym.UPDATE] = "UPDATE";
     symnames[sym.AS] = "AS";
     symnames[sym.SUM] = "SUM";
     symnames[sym.MAX] = "MAX";
     symnames[sym.MIN] = "MIN";
     symnames[sym.COUNT] = "COUNT";
     symnames[sym.AVG] = "AVG";
     symnames[sym.ORDER] = "ORDER";
     symnames[sym.HAVING] = "HAVING";
     symnames[sym.BY] = "BY";
     symnames[sym.GROUP] = "GROUP";

     symnames[sym.SET] = "SET";
     symnames[sym.PRIMARY] = "PRIMARY";
     symnames[sym.KEY] = "KEY";
     symnames[sym.INT] = "INT";
     symnames[sym.STRING] = "STRING";
     symnames[sym.ID] = "ID";
     symnames[sym.FOREIGN] = "FOREIGN";
     symnames[sym.EOF] = "EOF";
     symnames[sym.error] = "error";
     symnames[sym.COMM] = "COMM";
     symnames[sym.SEMI] = "SEMI";
     symnames[sym.LPAREN] = "LPAREN";
     symnames[sym.RPAREN] = "RPAREN";
     symnames[sym.PERIOD] = "PERIOD";
     symnames[sym.WHERE] = "WHERE";
     symnames[sym.FLT] = "FLT";

   }

}


